package com.flx.at.spring.code.test.testcircledepency;

import com.flx.at.spring.code.test.testcircledepency.component.X;
import com.flx.at.spring.code.test.testcircledepency.component.Y;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author: Fenglixiong
 * @Date: 2021/7/13 16:21
 * @Description:
 */
public class CircleDepencyApp {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(CircleConfig.class);
        //关闭循环依赖
        ctx.setAllowCircularReferences(false);
        System.out.println(ctx.getBean(X.class));
        System.out.println(ctx.getBean(Y.class));
        System.out.println(CircleConfig.class.getName());
        ctx.close();
    }

}
